const express = require('express')
const Mock = require('mockjs')
const router = express.Router()

// 获取统计数据
router.get('/', (req, res) => {
  const data = Mock.mock({
    overview: [
      {
        name: '今日预约人数',
        img: '@image(64x64,@color,ico)',
        'data|500-600': 5,
      }, {
        name: '今日挂号人数',
        img: '@image(64x64,@color,ico)',
        'data|600-800': 5,
      }, {
        name: '今日门诊充值总额',
        img: '@image(64x64,@color,ico)',
        'data|10000-50000': 5,
      }, {
        name: '今日门诊消费总额',
        img: '@image(64x64,@color,ico)',
        'data|30000-80000': 5,
      }, {
        name: '今日绑卡人数',
        img: '@image(64x64,@color,ico)',
        'data|200-400': 5,
      }
    ],
    'orders|7': [
      {
        'id|+1': 137232,
        date: '@date("M.d")',
        'orders|300-700': 7
      }
    ],
    'charges|7': [
      {
        'id|+1': 12349,
        date: '@date("M月d日")',
        'charges|10000-70000': 7
      }
    ],
    'hot': {
      'departments|5': [{
        'id|+327': 2832,
        name: '@ctitle(3,5)',
        'orders|120-150': 5
      }],
      'doctors|5': [{
        'id|+327': 2832,
        name: '@cname',
        'orders|120-150': 5
      }],
    }
  })
  res.json({
    code: 200,
    data
  })
})

module.exports = router
